<!doctype html>
<html lang="zh">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="description" content="">
	<meta name="keywords" content="">
	<title></title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
	<meta name="renderer" content="webkit">
	<link rel="stylesheet" href="css/normalize.css">
	<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div class="web-container">
	<div class="header"><h1 class="logo">黑光装修实景平台</h1></div>
	<div class="main">
		<!--商家列表-->
		<div class="section">
			<div class="shop-list"></div>
		</div>
	</div>
	<div class="footer">
		<div class="row fixed">
			<div class="sub-item">
				<a href="./"><i class="bg01"></i>首页</a>
			</div>
			<div class="sub-item">
				<a href="shop.html" class="on"><i class="bg02"></i>装修</a>
			</div>
			<div class="sub-item">
				<a href="shop.html"><i class="bg03"></i>实景</a>
			</div>
			<div class="sub-item">
				<a href="join.html"><i class="bg04"></i>入驻</a>
			</div>
		</div>
	</div>
</div>
<script src="js/lib/jquery.js"></script>
<script src="js/lib/Mdropload.js"></script>
<script src="js/main.js"></script>
<script>
	var page = 2;
	var pageUrl = 'callback.php?page=';
	var isLoading = false;	// 正在加载中
	var isHaveNot = false; // 是否已经加载完毕
	// 滚动代码
	var dropload = Mdropload(document.querySelector('.shop-list'), {
		height: 50,
		down: {
			fn: function (cb) {
				if (isLoading) {
					return false;
				}
				if (isHaveNot) {
					cb.end();
					return false;
				}
				isLoading = true;
				jQuery('.shop-list').ajaxInfo({
					url: pageUrl + page,
					cb: cb,
					sucess: function (data, cb) {
						jQuery('.shop-list').shopCallBack(data, cb);
					}
				});
			},
			template: {
				none: '上拉刷新',
				message: '释放更新',
				loading: '正在更新，请稍后',
				success: '刷新成功',
				end: '虾面没有了',
				error: '刷新失败'
			}
		}
	});
	jQuery('.shop-list').ajaxInfo({
		url: pageUrl + page,
		cb: null,
		sucess: function (data, cb) {
			jQuery('.shop-list').shopCallBack(data, cb);
		}
	});
	console.log(dropload.obj.classList[0]);
</script>
</body>
</html>
